export default function request(url, option = {}) {
  return new Promise((resolve, reject) => {
    fetch(
      url,
      {
        ...option
      }
    ).then(res => res.json()).then(data => {
      resolve(data);
    }).catch(err => {
      reject(err)
      console.log('请求失败'+url,err);
    })
  })
}